package com.wwwc.index.web.servlet;

import java.util.*;
import javax.servlet.http.*;
import java.rmi.RemoteException;

import com.wwwc.util.web.*;
//import com.wwwc.index.web.database.*;
import com.wwwc.index.web.ejb.database.*;

public class UserProfileSetting {
    private StringBuffer message;
    public StringBuffer getTempMessage() {
	return message;
    }
    /*
    public StringBuffer sendEmail(HttpSession session) {
	StringBuffer sbf = new StringBuffer();
	sbf.append("<HTML><HEAD><TITLE>Resend email</TITLE>\n");
	sbf.append("</HEAD><BODY><CENTER>");
	sbf.append("<H3>A verification e-mail has been sent to:["+session.get("user_email")+"]<BR>");
	sbf.append("Please open your e-mail and click the link that 3WCenter.com sent to you.<BR>");
	sbf.append("</FORM></CENTER></BODY></HTML>");

	String from    = "E-mail.Verification@3wcenter.com";
	String to      = email;
	String subject = "3WCenter E-mail Verification";        
	String content = null;
	SendMail smail = new SendMail ();
	String return_url = null;
	if(user_ip.startsWith(SystemInfo.LOCAL_IPS)) {
	    return_url = SystemInfo.LOCAL_URL_IP;
	}
	else {
	    return_url = SystemInfo.SERVER_URL;
	}

	String content = "<HTML><HEAD><TITLE></TITLE></HEAD><BODY>"+
	    "<H2>Welcome!</H2><BR>\n"+
	    "Please verify your account information:<BR>"+
	    "<BR>User name:&nbsp;"+user_name+
	    "<BR>User age group:&nbsp;"+user_age+
	    "<BR>You can modify your account information after you sign in.<BR><BR>"+
	    "<A href="+return_url+"/servlet/UserRegisterServlet?action=verify&email="+
	    user_email+"&user_name="+user_name+"&user_ip="+user_ip+"&v_code="+invoice+
	    ">Please click this link to verify your account"+
	    " information</A><BR>"+
	    "If you can not see the above link, please type:<BR><BR>\n\n"+
	    return_url+"/servlet/UserRegisterServlet?action=verify&email="+
	    user_email+"&user_name="+user_name+"&user_ip="+user_ip+"&v_code="+invoice+"<BR><BR>\n\n"+
	    "in your browser address field to verify.<BR>\nThank your!<BR>\n--3WCenter.com"+
	    "</BODY></HTML>";

	smail.setEmailFrom(from);
	smail.setEmailTo(to);
	smail.setEmailSubject(subject);
	smail.setEmailBody(content);
	String ms = smail.send();
    }
    */
    /*
      else {
      PasswdFileLoader ps_file_loader = new PasswdFileLoader();
      ps_file_loader.setFileName(new File("D:/myServers/ApacheGroup/Apache2/passwd", ".htaccess1"));
      ps_file_loader.loadFile();
      ps_ht = ps_file_loader.getHashtable();
      
      if (ps_ht.containsKey(user_name)) {
      httpConnecter c = new httpConnecter ();
      c.setUrl("http://192.168.1.103"); //send to authantication server
      c.setUserName(user_name);
      c.setPassWord(pass_word);
      
      if (((String)session.getAttribute("use_pin")).equals("true")) {
      Hashtable pin_hashtable = new Hashtable ();
      ps_file_loader.setFileName(new File("D:/myServers/ApacheGroup/Apache2/passwd", ".htaccess0"));
      ps_file_loader.loadFile();
      pin_hashtable = ps_file_loader.getHashtable();
      
      if(!pin_hashtable.get(session.getAttribute("pin_key")).equals(request.getParameter("pin"))) {
      RequestDispatcher rd = 
      request.getRequestDispatcher("/servlet/MainBarServlet?action=login_error"); 
      rd.forward(request,response);
      return;
      }
      }
      
      c.connecting();
      
      String conn_message   = c.getConnMessage();
      if (conn_message.equals("ResponseCode=200ResponseMessage=OK")) {
      user_info.put("user_name",user_name);
      user_info.put("user_age",user_age);
      user_info.put("user_level",user_level);
      user_info.put("user_ip",user_ip);
      user_info.put("view_age",view_age);
      session.setAttribute("user_info", user_info);
      session.setAttribute("count",null);
      out.println("AAAAAA"+user_info.toString());
      }
      else {
      RequestDispatcher rd = 
      request.getRequestDispatcher("/servlet/MainBarServlet?action=login_error"); 
      rd.forward(request,response);
      }
      }
      else {
      RequestDispatcher rd = request.getRequestDispatcher("/servlet/MainBarServlet?action=login_error"); 
      rd.forward(request,response);
      }
      }//paied user
      }
      else { // user_name or password error
      RequestDispatcher rd = request.getRequestDispatcher("/servlet/MainBarServlet?action=login_error"); 
      rd.forward(request,response);
      }
      
      }
      catch(Exception e) {
      return;
      }

      }
    */
}







